//
//  BVLoginTF.m
//  XiangYu
//
//  Created by YYKJ on 2017/6/5.
//  Copyright © 2017年 YYKJ. All rights reserved.
//

#import "BVLoginAndRegisTF.h"

@implementation BVLoginAndRegisTF

- (void)drawRect:(CGRect)rect {
    [super drawRect:rect];
    
    CGFloat SCREEN_WIDTH = [UIScreen mainScreen].bounds.size.width;
    UIToolbar *bar = [[UIToolbar alloc] initWithFrame:CGRectMake(0,0, SCREEN_WIDTH,44)];
    UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(SCREEN_WIDTH - 60, 7,50, 30)];
    [button setTitle:@"完成"forState:UIControlStateNormal];
    [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [button.titleLabel setFont:[UIFont systemFontOfSize:16]];
    
    [bar addSubview:button];
    self.inputAccessoryView = bar;
    
    [button addTarget:self action:@selector(print)forControlEvents:UIControlEventTouchUpInside];
    
    UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.height, self.height)];
    image.contentMode = UIViewContentModeCenter;
    image.image = self.img;
    self.leftView = image;
    self.leftViewMode = UITextFieldViewModeAlways;
    
}

- (void)print {
    
    [self resignFirstResponder];
}


@end
